package net.obxlabs.tweetpad.test;

import com.knowledgebooks.nlp.util.*;
import net.silentlycrashing.dictionary.*;
import processing.core.*;

public class T6Thesaurus extends PApplet {
	public void setup() {
        size(800, 600);
        frameRate(60);
        
        Thesaurus t = new Thesaurus("resources/th_en_US_new.idx", "resources/th_en_US_new.dat");
        FastTagger ft = new FastTagger();
        String s = "The quick brown fox jumped over the lazy dog.";
        String[] w = Tokenizer.wordsToArray(s);
        int[] tags = ft.tagWords(w);
        
        println(s);
        String sPrime;
        for (int j=0; j < 10; j++) {
        	sPrime = "";
        	for (int i=0; i < tags.length; i++) {
        		try {
        			sPrime += t.getWord(w[i]).getDumbSynonym(tags[i]);
        		} catch (Exception e) {
        			sPrime += w[i];
        		}
        		if (i < tags.length-2) {
        			sPrime += " ";
        		}
        	}
        	
        	println(sPrime);
        }
    }
    
    static public void main(String args[]) {     
    	PApplet.main(new String[] { "net.obxlabs.sketchpad.test.T6Thesaurus" });  
    }
}
